package com.itcast.polymorphic.Demo03;

/*
要写注释哦!!!
*/
public class Test {

    public static void main(String[] args) {
        method(new Zi());
        method(new Son());
    }

    public static void method(Fu fu) {

        if (fu instanceof Zi) {
            Zi zi = (Zi) fu;
            System.out.println(((Zi) fu).n);
            fu.menthodFu();
        }
        if (fu instanceof Son) {
            Son son = (Son) fu;
            System.out.println(((Son) fu).m);
            fu.menthodFu();
        }

    }
}
